package com.by.controller;

import com.by.common.core.controller.BaseController;
import com.by.entity.Order;
import com.by.service.OrderService;
import com.by.common.bean.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "订单管理")
@RequestMapping("/api")
public class OrderController extends BaseController {

    @Autowired
    OrderService orderService;

    @ApiOperation("保存订单")
    @PostMapping("/order")
    public ResultBean save(@RequestBody Order order) {
        int rs = orderService.saveEntity(order);
        return saveResult(rs);
    }
}
